package com.zone.vehicle.sdk.module.superapp.request;

import com.zone.sdk.common.http.base.BaseRequest;
import com.zone.vehicle.sdk.module.superapp.entity.StoreUtils;

import lombok.Data;
import lombok.EqualsAndHashCode;

@Data
@EqualsAndHashCode(callSuper=false)
public class AppListRequest extends BaseRequest {

    public AppListRequest(){
        manufacturer = StoreUtils.MANUFACTURER;
        business = StoreUtils.BUSINESS;
        clientType = StoreUtils.CLIENT_TYPE;
        salesChannel = StoreUtils.SALES_CHANNEL;
        isFree = null;
    }
    /**
     * 厂商(必填项目)
     */
    private String manufacturer = StoreUtils.MANUFACTURER;
    /**
     * 业务(必填项目)
     */
    private String business = StoreUtils.BUSINESS;
    /**
     * 名称
     */
    private String productName;
    /**
     * 发布开始时间 yyyy-MM-dd HH:mm:ss
     */
    private String startShelvesTime;
    /**
     * 发布结束时间 yyyy-MM-dd HH:mm:ss
     */
    private String endShelvesTime;
    /**
     * 有效开始时间 yyyy-MM-dd HH:mm:ss
     */
    private String startValidityTime;
    /**
     * 有效结束时间 yyyy-MM-dd HH:mm:ss
     */
    private String endValidityTime;
    /**
     * 是否免费（0：不免费；1：免费 默认不过滤）
     */
    private Integer isFree;
    /**
     * 价格区间最小值
     */
    private String priceMin;
    /**
     * 价格区间最大值
     */
    private String priceMax;
    /**
     * 标签
     */
    private String labelId;
    /**
     * 类目ID
     */
    private String categoryId;
    /**
     * 车型ID（可以为空）
     */
    private String vehicleTypeId;
    /**
     * 客户端名称
     */
    private String clientName;
    /**
     * 上架状态（0已上架1已下架 默认不过滤）
     */
    private String shelvesState;
    /**
     * 推荐状态（0未推荐1已推荐 默认不过滤）
     */
    private String recommendState;
    /**
     * 应用类型（1app2lightapp）
     */
    private String appType;
    /**
     * 安装状态（默认1）
     */
    private String state;

    /**
     * 客户端类型（APP、VEHICLE）
     */
    private String clientType = StoreUtils.CLIENT_TYPE;
    /**
     * 销售渠道（APP、VEHICLE）
     */
    private String salesChannel = StoreUtils.SALES_CHANNEL;

    private int homeShow = StoreUtils.HOME_SHOW;

    /**
     * 排序信息
     */
    private OrderBy orderBy;

    public String getType() {
        return appType;
    }

    public void setType(String type) {
        this.appType = type;
    }

    public String getState() {
        return state;
    }

    public void setState(String state) {
        this.state = state;
    }

    public OrderBy getOrderBy() {
        return orderBy;
    }

    public void setOrderBy(OrderBy orderBy) {
        this.orderBy = orderBy;
    }

    public int getHomeShow() {
        return homeShow;
    }

    public void setHomeShow(int homeShow) {
        this.homeShow = homeShow;
    }

    public String getShelvesState() {
        return shelvesState;
    }

    public void setShelvesState(String shelvesState) {
        this.shelvesState = shelvesState;
    }

    public static class OrderBy {
        /**
         * 排序字段 [“shelvesTimeTime”]确认预留字段
         */
        private String column = "c.sort";
        /**
         * 排序顺序（asc：升序；desc：降序）
         */
        private String sortType = "desc";

        public OrderBy(String column, String sortType) {
            this.column = column;
            this.sortType = sortType;
        }

        public String getColumn() {
            return column;
        }

        public void setColumn(String column) {
            this.column = column;
        }

        public String getSortType() {
            return sortType;
        }

        public void setSortType(String sortType) {
            this.sortType = sortType;
        }
    }
}
